package org.pskovgu.pskovbus;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class PointDbOpenHelper extends SQLiteOpenHelper{

	  private static final int DB_VERSION = 1;
	  private static final String DB_NAME = "buses";

	  public static final String TABLE_NAME = "routes";
	  public static final String POINT_ID = "point_id";
	  public static final String BUS_ID = "bus_id";
	  public static final String STATION_ID = "station_id";
	  public static final String REVERSE = "reverse";
	  public static final String TIME = "time";
	  public static final String WEEKDAYS = "weekdays";
	  private static final String CREATE_TABLE = 
	  "create table if not exists " + TABLE_NAME + " ("
		  + POINT_ID 	+ " INTEGER primary key autoincrement, "
	      + BUS_ID 		+ " INTEGER, "
	      + STATION_ID 	+ " INTEGER, "
	      + REVERSE 	+ " INTEGER, "
	      + TIME		+ " TEXT, "	      
	      + WEEKDAYS 	+ " TEXT)";

	  public PointDbOpenHelper(Context context) {
	    super(context, DB_NAME, null, DB_VERSION);
	  }

	  @Override
	  public void onCreate(SQLiteDatabase sqLiteDatabase) {
	    sqLiteDatabase.execSQL(CREATE_TABLE);
	  }

	  @Override
	  public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {
	  }
}